<template>
  <div class="reportMistakeInfoAction el-card is-always-shadow el-card__body">
<!--    </avue-crud>-->
    <el-dialog title="预览" :visible="dialogVisible" :gutter="24" @close="dialogVisible=false" width="60%">

    <div style="text-align: -webkit-center">
      <table>
        <tr style="line-height: 50px"><td style="text-align: right">发售数量(合计)：</td><td>{{formData.saleNumber}}</td><td style="min-width: 30px"></td> <td style="text-align: right">小计金额(合计)：</td><td>{{numToTwoPoint(formData.totalSaleAmount)}}</td></tr>
        <tr style="line-height: 50px;"><td style="text-align: right">开始时间：</td><td>{{formData.startTime}}</td> <td style="min-width: 30px"></td><td style="text-align: right">结束时间：</td><td>{{formData.endTime}}</td></tr>
      <tr style="line-height: 50px;"><td style="text-align: right">收益日期：</td><td>{{formData.revenueDate}}</td> <td style="min-width: 30px"></td><td style="text-align: right">设备编号：</td><td>{{formData.equipmentCode}}</td></tr>
      <tr style="line-height: 50px;"><td style="text-align: right">录入人：</td><td>{{formData.creatorName}}</td> <td style="min-width: 30px"></td><td style="text-align: right">录入时间：</td><td>{{formData.createTime}}</td></tr>
      </table>
      <!-- <avue-crud
        ref="crud"
        :option="option"
        :data="tableData"
        @search-change="handleFilter"
        @selection-change="selectionChange">

      </avue-crud> -->
      <div style="margin-top: 30px;">
        <div style="display: inline-flex"><span>备注：</span></div>
        <div style="display: inline-flex">
          <el-input
          type="textarea"
          :disabled="true"
          style="width: 400px"
          v-model="formData.remark"
        >
        </el-input>
        </div>

      </div>
      <div style="margin-top: 30px">
        <el-button plain @click.stop="dialogVisible=false">返回</el-button>
      </div>
    </div>
    </el-dialog>
  </div>
</template>


<script>
    import {getForm, postForm} from '@/api/gen/gen'
    import ExportJsonExcel from "js-export-excel";
    import moment from 'moment';
    import {
      getgetStationCodes,
      getLineCodes,fenExYuangettoFixed,getMappingStatus,numToTwoPoint
    } from "../../../../api/subwayRat/commonCheck";
    import {
      getXw_hlw_shouJieSuan_preview,
      hlwpreviewOption
    } from "../../../../api/stationTiecketManager/shouRuJieSuan/hlw/waitSubmitMain";

    export default {
      components:{
      },
      data() {
            return {
              dialogVisible : false,
              listLoading: true,
              fileTemp:{},
              formData:{},
              tableData:[],
              option:hlwpreviewOption(),
            }
        },
        created() {

        },
        methods: {
          moment,getMappingStatus,fenExYuangettoFixed,numToTwoPoint,
          search(row){
            Object.assign(this.formData,row);
            this.dialogVisible=true;
            let param={id:row.id,del_flag:'0'};
            getXw_hlw_shouJieSuan_preview(param).then((res)=>{
              this.tableData=res.data.data;
            });
          },
          handleSelectionChange(val,a){
            this.multipleSelectionRows=val;
            this.multipleSelectionKeys=[];
            for(let i=0;i<this.multipleSelectionRows.length;i++){
              this.multipleSelectionKeys.push(this.multipleSelectionRows[i].id);
            }
          },
          objectSpanMethod({ row, column, rowIndex, columnIndex }) {
            if (rowIndex==0 && columnIndex === 4) {
                return {
                  rowspan: this.tableData.length,
                  colspan: 1
                };
            }
          },
          initLine(){
            getLineCodes().then(res=>{ //获取线路
              this.lineCodes=res;
            });
          },
          changeLine(v){
            getgetStationCodes(v).then(res=>{
              this.stationCodes=res;
            })
          },

          selectionChange(list){
            this.multipleSelectionRows=list;
            this.multipleSelectionKeys=[];
            for(let i=0;i<list.length;i++){
              this.multipleSelectionKeys.push(list[i].id);
            }
          },
          handleFilter(params, done) {
            Object.assign(this.searchForm,params);
            done()
          },
        },
      mounted() {

      }
    }
</script>
<style lang="scss">

</style>
